<?php

namespace app\admin\validate\shop\delivery;

use think\Validate;

class Address extends Validate
{
    protected $failException = true;

    /**
     * 验证规则
     */
    protected $rule = [
        'name'           => 'require',
        'phone'          => 'require|mobile',
        'city'           => 'require',
        'type'           => 'require',
        'address_detail' => 'require'
    ];

    /**
     * 提示消息
     */
    protected $message = [
        'name.require'           => '收货联系人必须',
        'phone.require'          => '收货人联系方式必须',
        'phone.mobile'           => '收货人联系方式格式错误',
        'city.require'           => '收货人地区必须',
        'type.require'           => '收货人地址类型必须',
        'address_detail.require' => '收货人详细地址必须'
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => [],
        'edit' => [],
    ];

}
